package subumbo.game.renderer
{
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	
	public class RenderObject
	{
		private var _view:DisplayObject;
		private var _data:Renderable;
		
		public function RenderObject(view:DisplayObject, data:Renderable)
		{
			_view = view;
			_data = data;	
		}
		
		public function get view():DisplayObject
		{
			return _view;
		}
		
		public function render():void
		{
			var v:DisplayObject = _view;
			var d:Renderable = _data;
			
			
			v.x = d.x;
			v.y = d.y;
			v.rotation = d.rotation;
			if(d.length != 0) v.scaleY = d.length / 100;
			if(d.difference != 0) MovieClip(v).color = d.difference;
		}

	}
}